<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>催收预约表 管理</title>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>
<body class="iframeBody">
<form id="rskAppoRec_form">
    <div class="fieldset1 tabel_col tabel_col_1 clearFix">
        <div class="fieldBox col_100">
            <div class="label">预约时间</div>
            <div class="field">
                <input name="appoDt" id="appoDt" type="text" class="ui-datepicker" value="${rskAppoRecVO.appoDt}" validate="{required:true}">
                <span class="requiredSymbol">*</span>
            </div>
        </div>
    </div>
</form>
<script>
    var _ids=null;//预约客户ID、支付表ID集合
    $(function () {
        var dialog = frameElement.dialog; //调用页面的dialog对象(ligerui对象)
        var dialogData = dialog.get('data');//获取data参数
        if(dialogData){
            _ids=dialogData.ids;
        }

        var rskAppoRecId = "${rskAppoRecVO.id}";//主键ID

        $("#rskAppoRec_form").ligerForm({
            validate: true
        });

        //按钮在页面外的Dialog里，给Dialog绑定事件 （onOk 和 onCancel）
        frameElement.dialog.onOk = function () {
            var form = liger.get("rskAppoRec_form");
            if (!form.valid()) {
                $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
                return false; //验证不通过，不执行以下代码
            }
            var data = form.getData();
            data['ids']=JSON.stringify(_ids);
            $.ligerDialog.hide();

            var wait_dialog;
            $.ajax({
                type: 'post',
                dataType: 'json',
                data: data,
                url: '<%=path%>/risk/rskAppoRec/add.do',
                beforeSend: function () {
                    wait_dialog = $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting"});
                },
                success: function (msg) {
                    wait_dialog.close();
                    if (msg.success == 1) {
                        $.ligerDialog.SQalert({content: msg.info, SQ_type: "success"});
                        parent.$("#clearBtn").click();
                        parent.$("#searchBtn").click();
                        frameElement.dialog.close();
                    } else {
                        $.ligerDialog.SQalert({content: msg.info, SQ_type: "error"});
                    }
                }
            });
        };
        frameElement.dialog.onCancel = function () {
            frameElement.dialog.hide();
        };

    });
</script>
</body>
</html>
